
package com.efounder.news.utils;

import androidx.collection.ArrayMap;

import com.efounder.mobilenews.R;

import java.util.ArrayList;


/**
 * @description :表情加载类,可自己添加多种表情，分别建立不同的map存放和不同的标志符即可
 */
public class EmotionUtils {
	private static final String TAG = "EmotionUtils";

	public static final String ee_1 = "[微笑]";
	public static final String ee_2 = "[撇嘴]";
	public static final String ee_3 = "[色]";
	public static final String ee_4 = "[发呆]";
	public static final String ee_5 = "[得意]";
	public static final String ee_6 = "[流泪]";
	public static final String ee_7 = "[害羞]";
	public static final String ee_8 = "[闭嘴]";
	public static final String ee_9 = "[睡]";
	public static final String ee_10 = "[大哭]";
	public static final String ee_11 = "[尴尬]";
	public static final String ee_12 = "[发怒]";
	public static final String ee_13 = "[调皮]";
	public static final String ee_14 = "[呲牙]";
	public static final String ee_15 = "[惊讶]";
	public static final String ee_16 = "[难过]";
	public static final String ee_17 = "[酷]";
	public static final String ee_18 = "[冷汗]";
	public static final String ee_19 = "[抓狂]";
	public static final String ee_20 = "[吐]";
	public static final String ee_21 = "[偷笑]";
	public static final String ee_22 = "[白眼]";
	public static final String ee_23 = "[可爱]";
	public static final String ee_24 = "[傲慢]";
	public static final String ee_25 = "[饥饿]";
	public static final String ee_26 = "[困]";
	public static final String ee_27 = "[惊恐]";
	public static final String ee_28 = "[流汗]";
	public static final String ee_29 = "[憨笑]";
	public static final String ee_30 = "[大兵]";
	public static final String ee_31 = "[奋斗]";
	public static final String ee_32 = "[咒骂]";
	public static final String ee_33 = "[疑问]";
	public static final String ee_34 = "[嘘]";
	public static final String ee_35 = "[晕]";
	public static final String ee_36 = "[猪头]";
	public static final String ee_37 = "[衰]";
	public static final String ee_38 = "[骷髅]";
	public static final String ee_39 = "[敲打]";
	public static final String ee_40 = "[再见]";
	public static final String ee_41 = "[擦汗]";
	public static final String ee_42 = "[抠鼻]";
	public static final String ee_43 = "[鼓掌]";
	public static final String ee_44 = "[糗大了]";
	public static final String ee_45 = "[坏笑]";
	public static final String ee_46 = "[左哼哼]";
	public static final String ee_47 = "[右哼哼]";
	public static final String ee_48 = "[哈欠]";
	public static final String ee_49 = "[鄙视]";
	public static final String ee_50 = "[委屈]";
	public static final String ee_51 = "[快哭了]";
	public static final String ee_52 = "[阴险]";
	public static final String ee_53 = "[亲亲]";
	public static final String ee_54 = "[吓]";
	public static final String ee_55 = "[可怜]";
	public static final String ee_56 = "[菜刀]";
	public static final String ee_57 = "[西瓜]";
	public static final String ee_58 = "[啤酒]";
	public static final String ee_59 = "[篮球]";
	public static final String ee_60 = "[足球]";
	public static final String ee_61 = "[乒乓球]";
	public static final String ee_62 = "[咖啡]";
	public static final String ee_63 = "[饭]";
	public static final String ee_64 = "[玫瑰]";
	public static final String ee_65 = "[凋谢]";
	public static final String ee_66 = "[示爱]";
	public static final String ee_67 = "[爱心]";
	public static final String ee_68 = "[心碎]";
	public static final String ee_69 = "[蛋糕]";
	public static final String ee_70 = "[闪电]";
	public static final String ee_71 = "[炸弹]";
	public static final String ee_72 = "[刀]";
	public static final String ee_73 = "[飘虫]";
	public static final String ee_74 = "[便便]";
	public static final String ee_75 = "[月亮]";
	public static final String ee_76 = "[太阳]";
	public static final String ee_77 = "[礼物]";
	public static final String ee_78 = "[拥抱]";
	public static final String ee_79 = "[强]";
	public static final String ee_80 = "[弱]";
	public static final String ee_81 = "[握手]";
	public static final String ee_82 = "[胜利]";
	public static final String ee_83= "[抱拳]";
	public static final String ee_84 = "[勾引]";
	public static final String ee_85 = "[拳头]";
	public static final String ee_86 = "[差劲]";
	public static final String ee_87 = "[爱你]";
	public static final String ee_88 = "[NO]";
	public static final String ee_89 = "[OK]";

	/**
	 * 表情类型标志符
	 */
	public static final int EMOTION_CLASSIC_TYPE=0x0001;//经典表情

	/**
	 * key-表情文字;
	 * value-表情图片资源
	 */
	public static ArrayMap<String, Integer> EMPTY_MAP;
	public static ArrayMap<String, Integer> EMOTION_CLASSIC_MAP;
	public static ArrayList<String> KEY_LIST;


	static {
		EMPTY_MAP = new ArrayMap<>();
//		EMOTION_CLASSIC_MAP = new ArrayMap<>();
		EMOTION_CLASSIC_MAP = new ArrayMap();
		KEY_LIST = new ArrayList<>();

		EMOTION_CLASSIC_MAP.put( ee_1, R.drawable.ee_1);
		EMOTION_CLASSIC_MAP.put( ee_2, R.drawable.ee_2);
		EMOTION_CLASSIC_MAP.put( ee_3, R.drawable.ee_3);
		EMOTION_CLASSIC_MAP.put( ee_4, R.drawable.ee_4);
		EMOTION_CLASSIC_MAP.put( ee_5, R.drawable.ee_5);
		EMOTION_CLASSIC_MAP.put( ee_6, R.drawable.ee_6);
		EMOTION_CLASSIC_MAP.put( ee_7, R.drawable.ee_7);
		EMOTION_CLASSIC_MAP.put( ee_8, R.drawable.ee_8);
		EMOTION_CLASSIC_MAP.put( ee_9, R.drawable.ee_9);
		EMOTION_CLASSIC_MAP.put( ee_10, R.drawable.ee_10);
		EMOTION_CLASSIC_MAP.put( ee_11, R.drawable.ee_11);
		EMOTION_CLASSIC_MAP.put( ee_12, R.drawable.ee_12);
		EMOTION_CLASSIC_MAP.put( ee_13, R.drawable.ee_13);
		EMOTION_CLASSIC_MAP.put( ee_14, R.drawable.ee_14);
		EMOTION_CLASSIC_MAP.put( ee_15, R.drawable.ee_15);
		EMOTION_CLASSIC_MAP.put( ee_16, R.drawable.ee_16);
		EMOTION_CLASSIC_MAP.put( ee_17, R.drawable.ee_17);
		EMOTION_CLASSIC_MAP.put( ee_18, R.drawable.ee_18);
		EMOTION_CLASSIC_MAP.put( ee_19, R.drawable.ee_19);
		EMOTION_CLASSIC_MAP.put( ee_20, R.drawable.ee_20);
		EMOTION_CLASSIC_MAP.put( ee_21, R.drawable.ee_21);
		EMOTION_CLASSIC_MAP.put( ee_22, R.drawable.ee_22);
		EMOTION_CLASSIC_MAP.put( ee_23, R.drawable.ee_23);
		EMOTION_CLASSIC_MAP.put( ee_24, R.drawable.ee_24);
		EMOTION_CLASSIC_MAP.put( ee_25, R.drawable.ee_25);
		EMOTION_CLASSIC_MAP.put( ee_26, R.drawable.ee_26);
		EMOTION_CLASSIC_MAP.put( ee_27, R.drawable.ee_27);
		EMOTION_CLASSIC_MAP.put( ee_28, R.drawable.ee_28);
		EMOTION_CLASSIC_MAP.put( ee_29, R.drawable.ee_29);
		EMOTION_CLASSIC_MAP.put( ee_30, R.drawable.ee_30);
		EMOTION_CLASSIC_MAP.put( ee_31, R.drawable.ee_31);
		EMOTION_CLASSIC_MAP.put( ee_32, R.drawable.ee_32);
		EMOTION_CLASSIC_MAP.put( ee_33, R.drawable.ee_33);
		EMOTION_CLASSIC_MAP.put( ee_34, R.drawable.ee_34);
		EMOTION_CLASSIC_MAP.put( ee_35, R.drawable.ee_35);
		EMOTION_CLASSIC_MAP.put( ee_36, R.drawable.ee_36);
		EMOTION_CLASSIC_MAP.put( ee_37, R.drawable.ee_37);
		EMOTION_CLASSIC_MAP.put( ee_38, R.drawable.ee_38);
		EMOTION_CLASSIC_MAP.put( ee_39, R.drawable.ee_39);
		EMOTION_CLASSIC_MAP.put( ee_40, R.drawable.ee_40);
		EMOTION_CLASSIC_MAP.put( ee_41, R.drawable.ee_41);
		EMOTION_CLASSIC_MAP.put( ee_42, R.drawable.ee_42);
		EMOTION_CLASSIC_MAP.put( ee_43, R.drawable.ee_43);
		EMOTION_CLASSIC_MAP.put( ee_44, R.drawable.ee_44);
		EMOTION_CLASSIC_MAP.put( ee_45, R.drawable.ee_45);
		EMOTION_CLASSIC_MAP.put( ee_46, R.drawable.ee_46);
		EMOTION_CLASSIC_MAP.put( ee_47, R.drawable.ee_47);
		EMOTION_CLASSIC_MAP.put( ee_48, R.drawable.ee_48);
		EMOTION_CLASSIC_MAP.put( ee_49, R.drawable.ee_49);
		EMOTION_CLASSIC_MAP.put( ee_50, R.drawable.ee_50);
		EMOTION_CLASSIC_MAP.put( ee_51, R.drawable.ee_51);
		EMOTION_CLASSIC_MAP.put( ee_52, R.drawable.ee_52);
		EMOTION_CLASSIC_MAP.put( ee_53, R.drawable.ee_53);
		EMOTION_CLASSIC_MAP.put( ee_54, R.drawable.ee_54);
		EMOTION_CLASSIC_MAP.put( ee_55, R.drawable.ee_55);
		EMOTION_CLASSIC_MAP.put( ee_56, R.drawable.ee_56);
		EMOTION_CLASSIC_MAP.put( ee_57, R.drawable.ee_57);
		EMOTION_CLASSIC_MAP.put( ee_58, R.drawable.ee_58);
		EMOTION_CLASSIC_MAP.put( ee_59, R.drawable.ee_59);
		EMOTION_CLASSIC_MAP.put( ee_60, R.drawable.ee_60);
		EMOTION_CLASSIC_MAP.put( ee_61, R.drawable.ee_61);
		EMOTION_CLASSIC_MAP.put( ee_62, R.drawable.ee_62);
		EMOTION_CLASSIC_MAP.put( ee_63, R.drawable.ee_63);
		EMOTION_CLASSIC_MAP.put( ee_64, R.drawable.ee_64);
		EMOTION_CLASSIC_MAP.put( ee_65, R.drawable.ee_65);
		EMOTION_CLASSIC_MAP.put( ee_66, R.drawable.ee_66);
		EMOTION_CLASSIC_MAP.put( ee_67, R.drawable.ee_67);
		EMOTION_CLASSIC_MAP.put( ee_68, R.drawable.ee_68);
		EMOTION_CLASSIC_MAP.put( ee_69, R.drawable.ee_69);
		EMOTION_CLASSIC_MAP.put( ee_70, R.drawable.ee_70);
		EMOTION_CLASSIC_MAP.put( ee_71, R.drawable.ee_71);
		EMOTION_CLASSIC_MAP.put( ee_72, R.drawable.ee_72);
		EMOTION_CLASSIC_MAP.put( ee_73, R.drawable.ee_73);
		EMOTION_CLASSIC_MAP.put( ee_74, R.drawable.ee_74);
		EMOTION_CLASSIC_MAP.put( ee_75, R.drawable.ee_75);
		EMOTION_CLASSIC_MAP.put( ee_76, R.drawable.ee_76);
		EMOTION_CLASSIC_MAP.put( ee_77, R.drawable.ee_77);
		EMOTION_CLASSIC_MAP.put( ee_78, R.drawable.ee_78);
		EMOTION_CLASSIC_MAP.put( ee_79, R.drawable.ee_79);
		EMOTION_CLASSIC_MAP.put( ee_80, R.drawable.ee_80);
		EMOTION_CLASSIC_MAP.put( ee_81, R.drawable.ee_81);
		EMOTION_CLASSIC_MAP.put( ee_82, R.drawable.ee_82);
		EMOTION_CLASSIC_MAP.put( ee_83, R.drawable.ee_83);
		EMOTION_CLASSIC_MAP.put( ee_84, R.drawable.ee_84);
		EMOTION_CLASSIC_MAP.put( ee_85, R.drawable.ee_85);
		EMOTION_CLASSIC_MAP.put( ee_86, R.drawable.ee_86);
		EMOTION_CLASSIC_MAP.put( ee_87, R.drawable.ee_87);
		EMOTION_CLASSIC_MAP.put( ee_88, R.drawable.ee_88);
		EMOTION_CLASSIC_MAP.put( ee_89, R.drawable.ee_89);

		KEY_LIST.add(ee_1);
		KEY_LIST.add(ee_2);
		KEY_LIST.add(ee_3);
		KEY_LIST.add(ee_4);
		KEY_LIST.add(ee_5);
		KEY_LIST.add(ee_6);
		KEY_LIST.add(ee_7);
		KEY_LIST.add(ee_8);
		KEY_LIST.add(ee_9);
		KEY_LIST.add(ee_10);
		KEY_LIST.add(ee_11);
		KEY_LIST.add(ee_12);
		KEY_LIST.add(ee_13);
		KEY_LIST.add(ee_14);
		KEY_LIST.add(ee_15);
		KEY_LIST.add(ee_16);
		KEY_LIST.add(ee_17);
		KEY_LIST.add(ee_18);
		KEY_LIST.add(ee_19);
		KEY_LIST.add(ee_20);
		KEY_LIST.add(ee_21);
		KEY_LIST.add(ee_22);
		KEY_LIST.add(ee_23);
		KEY_LIST.add(ee_24);
		KEY_LIST.add(ee_25);
		KEY_LIST.add(ee_26);
		KEY_LIST.add(ee_27);
		KEY_LIST.add(ee_28);
		KEY_LIST.add(ee_29);
		KEY_LIST.add(ee_30);
		KEY_LIST.add(ee_31);
		KEY_LIST.add(ee_32);
		KEY_LIST.add(ee_33);
		KEY_LIST.add(ee_34);
		KEY_LIST.add(ee_35);
		KEY_LIST.add(ee_36);
		KEY_LIST.add(ee_37);
		KEY_LIST.add(ee_38);
		KEY_LIST.add(ee_39);
		KEY_LIST.add(ee_40);
		KEY_LIST.add(ee_41);
		KEY_LIST.add(ee_42);
		KEY_LIST.add(ee_43);
		KEY_LIST.add(ee_44);
		KEY_LIST.add(ee_45);
		KEY_LIST.add(ee_46);
		KEY_LIST.add(ee_47);
		KEY_LIST.add(ee_48);
		KEY_LIST.add(ee_49);
		KEY_LIST.add(ee_50);
		KEY_LIST.add(ee_51);
		KEY_LIST.add(ee_52);
		KEY_LIST.add(ee_53);
		KEY_LIST.add(ee_54);
		KEY_LIST.add(ee_55);
		KEY_LIST.add(ee_56);
		KEY_LIST.add(ee_57);
		KEY_LIST.add(ee_58);
		KEY_LIST.add(ee_59);
		KEY_LIST.add(ee_60);
		KEY_LIST.add(ee_61);
		KEY_LIST.add(ee_62);
		KEY_LIST.add(ee_63);
		KEY_LIST.add(ee_64);
		KEY_LIST.add(ee_65);
		KEY_LIST.add(ee_66);
		KEY_LIST.add(ee_67);
		KEY_LIST.add(ee_68);
		KEY_LIST.add(ee_69);
		KEY_LIST.add(ee_70);
		KEY_LIST.add(ee_71);
		KEY_LIST.add(ee_72);
		KEY_LIST.add(ee_73);
		KEY_LIST.add(ee_74);
		KEY_LIST.add(ee_75);
		KEY_LIST.add(ee_76);
		KEY_LIST.add(ee_77);
		KEY_LIST.add(ee_78);
		KEY_LIST.add(ee_79);
		KEY_LIST.add(ee_80);
		KEY_LIST.add(ee_81);
		KEY_LIST.add(ee_82);
		KEY_LIST.add(ee_83);
		KEY_LIST.add(ee_84);
		KEY_LIST.add(ee_85);
		KEY_LIST.add(ee_86);
		KEY_LIST.add(ee_87);
		KEY_LIST.add(ee_88);
		KEY_LIST.add(ee_89);
//		EMOTION_CLASSIC_MAP.put("[兔子]", R.drawable.d_tuzi);
	}

	/**
	 * 根据名称获取当前表情图标R值
	 * @param EmotionType 表情类型标志符
	 * @param imgName 名称
	 * @return
	 */
	public static int getImgByName(int EmotionType,String imgName) {
		Integer integer=null;
		switch (EmotionType){
			case EMOTION_CLASSIC_TYPE:
				integer = EMOTION_CLASSIC_MAP.get(imgName);
				break;
			default:
				LogUtils.e(TAG, "the emojiMap is null!! Handle Yourself ");
				break;
		}
		return integer == null ? -1 : integer;
	}

	/**
	 * 根据类型获取表情数据
	 * @param EmotionType
	 * @return
	 */
	public static ArrayMap<String, Integer> getEmojiMap(int EmotionType){
		ArrayMap EmojiMap=null;
		switch (EmotionType){
			case EMOTION_CLASSIC_TYPE:
				EmojiMap=EMOTION_CLASSIC_MAP;
				break;
			default:
				EmojiMap=EMPTY_MAP;
				break;
		}
		return EmojiMap;
	}

	public static ArrayList<String> getKeyList(int EmotionType){
		ArrayMap EmojiMap=null;
		if(EmotionType == EMOTION_CLASSIC_TYPE){
			return KEY_LIST;
		}else{
			getEmojiMap(EmotionType);
			return null;
		}
	}
}
